<!--河南星辰软件科技有限公司
@copyright Copyright (c) 2010~2022 All rights reserved.
-->
<template>
  <div class='app-container'>
    <el-form ref="form" :model="t_quote" :rules="rules" label-width="100px" id="mvcfm">
      <div class="form-unit">
        <span class="mvc-title-left"> 执行详情 </span>
      </div>
      <div>
        <el-row>
          <el-col :span="24">
            <el-form-item label="仓库" prop="">
              {{t_quote.firm_name}}
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="24">
            <el-form-item label="盘存类别" prop="">
              {{t_quote.take_interval}}
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="24">
            <el-form-item label="盘存标题" prop="">
              {{t_quote.quote_name}}
            </el-form-item>
          </el-col>
        </el-row>
      </div>
      <el-button @click="finManConfirmSubmit('')" type='success' size="mini"><i class='fa fa-check'></i>提交</el-button>
      <el-button @click="gotoPage('/psi/supplychainmana/InventoryDet?'+vueparams+'')" type='primary' size="mini"><i class='fa fa-reply'></i>返回</el-button>
      <div class="form-unit">
        <span class="mvc-title-left"> 产品列表 </span>
      </div>
      <el-table :data="s_product">
        <el-table-column label="#" align="center" type='index'>
        </el-table-column>
        <el-table-column label="产品条形码" prop="product_barcode">
        </el-table-column>
        <el-table-column label="产品名称" prop="product_name">
        </el-table-column>
        <el-table-column label="规格型号" prop="model_norm">
        </el-table-column>
        <el-table-column label="产品厂家" prop="client_name">
        </el-table-column>
        <el-table-column label="储存位置" prop="name">
        </el-table-column>
        <el-table-column label="结余数" prop="product_num">
        </el-table-column>
        <el-table-column label="盘存数" prop="take_num">
        </el-table-column>
        <el-table-column label="差异数" prop="pln">
        </el-table-column>
        <el-table-column label="状态" prop="take_confin">
          <template slot-scope="scope">
            {{getValueName("未处理=1,已确认=2",scope.row.take_confin)}}
          </template>
        </el-table-column>
        <el-table-column label="操作" prop="">
          <template slot-scope="scope">
            <el-link @click="gotoPage('/psi/supplychainmana/FinancialConfirmDet?CMIDnote_id='+scope.row.note_id+'&cpopup=reload'+vueparams+'')" type='primary'>检查</el-link>
          </template>
        </el-table-column>
      </el-table>
    </el-form>
  </div>
</template>
<script>
  import request from '@/utils/request'
  export default {
    name: 'FinManConfirm',
    components: {},
    props: ['popparams'],
    data() {
      return {
        vueparams: this.getVUEParams(""),
        t_quote: {
          firm_name: null,
          take_interval: null,
          quote_name: null,
        },
        s_product: [],
        loading: false,
        rules: {}
      }
    },
    created() {
      this.getData();
    },
    updated() {},
    mounted() {},
    methods: {
      getData() {
        request({
          method: 'get',
          url: '/xcapi/VUEAction/psi/main/InventoryAction/finManConfirm?' + this.vueparams,
        }).then(data => {
          for (var k in data) {
            if (Array.isArray(data[k])) {
              this[k] = data[k];
            } else {
              $.extend(this[k], data[k]);
            }
          }
        })
      },
      finManConfirmSubmit(_params) {
        this.$refs["form"].validate(valid => {
          if (valid) {
            request({
              method: 'post',
              url: '/xcapi/VUEAction/psi/main/InventoryAction/finManConfirmSubmit?' + _params + this.vueparams,
              data: this.postData()
            }).then(data => {
              this.gotoPage("/psi/supplychainmana/InventoryDet/inventoryDet?" + this.vueparams, data);
              this.msgSuccess(data.msg);
            })
          } else {
            this.msgError("必填项错误");
          }
        });
      },
    },
  }
</script>
